home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
bix02.arc
/
PRINTSCR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-08-04
|
2KB
|
70 lines
{enable/disable Shift-PrtSc from Turbo}
{ 851022 pavel. Derived from TurboPascal 3.0 DOSFCALL.DOC
and the users of BIX.
Compiled with PC-DOS TurboPascal ver 3.01A
on an IBM-PC, DOS 2.1
NOTE: If compiling to a .COM file, set all min/max code/data/stack
segments to a low value, such as 200, to prevent reloading
of command.com !
}
PROGRAM PrintScr;
{
Enables/disables SHIFT-PRINTSCREEN by setting DOS vector 5
to point to dummy IRET instruction at $F000:$FF53.
Uses standard DOS setvec ($25) call.
}
VAR
ch : Char;
PROCEDURE SetVector( Vector, AddressHi, AddressLo : Integer);
TYPE
RegPack = RECORD
ax,bx,cx,dx,bp,si,di,ds,es,flags: Integer;
END;
VAR
RecPack: RegPack; {record for MsDos call}
BEGIN
WITH RecPack DO
BEGIN
ax := $25 shl 8; { DOS "Set Interrupt Vector" routine}
ax := ax + Vector;
ds := AddressHi;
dx := AddressLo;
END;
MsDos(recpack); { call function }
END;
PROCEDURE EnablePrintScr;
BEGIN
SetVector( 5, -4096, -172); { address of print-screen }
END;
PROCEDURE DisablePrintScr;
BEGIN
SetVector( 5, $F000, $FF53); { address of dummy return }
END;
BEGIN { MAIN }
REPEAT
WriteLn(' Enter: E(nable / D(isable print-screen Q(uit');
Read( KBD, ch);
IF ch in ['e','E']
THEN
BEGIN
EnablePrintScr;
WriteLn(' Shift-PrintScreen is ENabled');
END
ELSE IF ch in ['d','D']
THEN
BEGIN
DisablePrintScr;
WriteLn(' Shift-PrintScreen is DISabled');
END;
UNTIL ch in ['q','Q'];
END.